// https://www.acwing.com/problem/content/842/

#include <iostream>
#include <cstring>

using namespace std;

// 拉链法

const int MOD = 100003;

// 所有的槽
int h[MOD];
// 链表
int e[MOD], ne[MOD];
// 当前链表的位置
int idx;

void Insert(int x) {
    int k = (x % MOD + MOD) % MOD;
    e[idx] = x;
    ne[idx] = h[k];
    h[k] = idx++;
}

bool Find(int x) {
    int k = (x % MOD + MOD) % MOD;
    for (int i=h[k]; i != -1; i = ne[i]) {
        if (e[i] == x) {
            return true;
        }
    }
    return false;
}


int main() {
    int n, tmp;
    char op[2];
    scanf("%d", &n);
    memset(h, -1, sizeof h);
    while (n-->0) {
        scanf("%s%d", &op, &tmp);
        if (*op == 'I') {
            Insert(tmp);
        } else if (*op == 'Q') {
            if (Find(tmp)) {
                cout<<"Yes"<<endl;
            } else {
                cout<<"No"<<endl;
            }
        }
    }
    return 0;
}
